﻿Public Class LopHocDAO
    Public Shared Function SelectAll() As DataTable
        Dim strSQL As String = "select * from LOPHOC"
        Dim dt As DataTable
        dt = Provider.ExecQuery(strSQL)
        Return dt
    End Function

    Public Shared Sub Insert(ByVal _lh As LopHocDTO)
        Dim strSQL As String = "Insert into LOPHOC(TenLop, NamTuyenSinh)  Values('" & _lh.TenLop & "','" & _lh.NamTuyenSinh & "')"
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Delete(ByVal _lh As LopHocDTO)
        Dim strSQL As String = "delete from LOPHOC where MaLop = " & _lh.MaLop
        Provider.ExecNoneQuery(strSQL)
    End Sub

    Public Shared Sub Update(ByVal _lh As LopHocDTO)
        Dim strSQL As String = "Update LOPHOC set TenLop = '" & _lh.TenLop & "', NamTuyenSinh = '" & _lh.NamTuyenSinh & "' Where MaLop = " & _lh.MaLop
        Provider.ExecNoneQuery(strSQL)
    End Sub
End Class
